<template>
  <div class="topNav">
    <!-- 列表图标 -->
    <div class="topLeft">
      <svg class="icon" aria-hidden="true" @click="showPopup">
          <use xlink:href="#icon-liebiao2"></use>
      </svg>
    </div>
    <!-- 文字导航 -->
    <div class="topCenter">
      <span class="navBtn" @click="$router.push({path: '/me'})">我的</span>
      <span class="navBtn active">发现</span>
      <span class="navBtn">云村</span>
      <span class="navBtn">视频</span>
    </div>
    <!-- 搜索图标 -->
    <div class="topRight" @click="$router.push({path: '/search'})">
      <svg class="icon search" aria-hidden="true">
          <use xlink:href="#icon-sousuo"></use>
      </svg>
    </div>
  </div>

  <!-- 左弹出层 -->
  <van-popup v-model:show="show" :position="'left'"  closeable :style="{ width:'85%',height: '100%' }">
    吃饭睡觉打豆豆
  </van-popup>
</template>

<script setup>
import { ref } from "vue";

const show = ref(false);
const showPopup = () => {
  show.value = true
}
</script>

<style lang="less" scoped>
.topNav {
  width: 7.5rem;
  height: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 0.2rem;
  background-color: #ec4141;
  color: #fff;
  .icon {
    width: 0.5rem;
    height: 0.5rem;
  }
  .search {
    width: 0.45rem;
    height: 0.45rem;
  }
  .topCenter {
    width: 4.5rem;
    display: flex;
    justify-content: space-around;
    .active {
      font-weight: 900;
    }
  }
}
</style>